clear all;
clc;

%% ---------------------- Epidural ----------------------------------------

dc0_epi_adtech=[42,25,30,33,31];
dc0_epi_lt1p5=[22,25,30,33,38];
dc0_epi_lt6=[23,25,30,38,38];
dc0_epi_tt1=[23,0,39,45,27];
dc0_epi_tt3=[13,0,28,30,22];
dc0_epi_at=[22,12,33,36,33];

mean(dc0_epi_lt1p5)
mean(dc0_epi_lt6)
mean(dc0_epi_tt1)
mean(dc0_epi_tt3)
mean(dc0_epi_at)

% dc0 vs. electrode design
% 5 designs
% => 10 combinations: 1-2, 1-3, 1-4, 1-5, 2-3, 3-4, 2-5, 3-4, 3-5, 4-5
% 1 = lt1p5, longitudinal tripole, IES = 1.5 mm
% 2 = lt6, longitudinal tripole, IES = 6 mm
% 3 = tt1, transverse tripole, IES = 1 mm
% 4 = tt3, transverse tripole, IES = 3 mm
% 5 = at, angular tripole
h_1v2=kstest2(dc0_epi_lt1p5,dc0_epi_lt6)
h_1v3=kstest2(dc0_epi_lt1p5,dc0_epi_tt1)
h_1v4=kstest2(dc0_epi_lt1p5,dc0_epi_tt3)
h_1v5=kstest2(dc0_epi_lt1p5,dc0_epi_at)
h_2v3=kstest2(dc0_epi_lt6,dc0_epi_tt1)
h_2v4=kstest2(dc0_epi_lt6,dc0_epi_tt3)
h_2v5=kstest2(dc0_epi_lt6,dc0_epi_at)
h_3v4=kstest2(dc0_epi_tt1,dc0_epi_tt3)
h_3v5=kstest2(dc0_epi_tt1,dc0_epi_at)
h_4v5=kstest2(dc0_epi_tt3,dc0_epi_at)

%% -------------------- Subdural ------------------------------------------

dc0_sub_adtech=[66,43,51,50,52];
dc0_sub_lt1p5=[40,40,42,40,45];
dc0_sub_lt6=[46,47,49,50,56];
dc0_sub_tt1=[68,68,72,71,73];
dc0_sub_tt3=[58,51,65,62,65];
dc0_sub_at=[80,78,83,82,83];    

mean(dc0_sub_lt1p5)
mean(dc0_sub_lt6)
mean(dc0_sub_tt1)
mean(dc0_sub_tt3)
mean(dc0_sub_at)

% dc0 vs. electrode design
% 5 designs
% => 10 combinations: 1-2, 1-3, 1-4, 1-5, 2-3, 3-4, 2-5, 3-4, 3-5, 4-5
% 1 = lt1p5, longitudinal tripole, IES = 1.5 mm
% 2 = lt6, longitudinal tripole, IES = 6 mm
% 3 = tt1, transverse tripole, IES = 1 mm
% 4 = tt3, transverse tripole, IES = 3 mm
% 5 = at, angular tripole
[h_1v2,p_1v2]=kstest2(dc0_sub_lt1p5,dc0_sub_lt6)
[h_1v3,p_1v3]=kstest2(dc0_sub_lt1p5,dc0_sub_tt1)
[h_1v4,p_1v4]=kstest2(dc0_sub_lt1p5,dc0_sub_tt3)
[h_1v5,p_1v5]=kstest2(dc0_sub_lt1p5,dc0_sub_at)
[h_2v3,p_2v3]=kstest2(dc0_sub_lt6,dc0_sub_tt1)
[h_2v4,p_2v4]=kstest2(dc0_sub_lt6,dc0_sub_tt3)
[h_2v5,p_2v5]=kstest2(dc0_sub_lt6,dc0_sub_at)
[h_3v4,p_3v4]=kstest2(dc0_sub_tt1,dc0_sub_tt3)
[h_3v5,p_3v5]=kstest2(dc0_sub_tt1,dc0_sub_at)
[h_4v5,p_4v5]=kstest2(dc0_sub_tt3,dc0_sub_at)

%% ------------------ Subdural vs. Epidural -------------------------------

[h_subvsepi_lt1p5,p1]=kstest2(dc0_sub_lt1p5,dc0_epi_lt1p5)
[h_subvsepi_lt6,p2]=kstest2(dc0_sub_lt6,dc0_epi_lt6)
[h_subvsepi_tt1,p3]=kstest2(dc0_sub_tt1,dc0_epi_tt1)
[h_subvsepi_tt3,p4]=kstest2(dc0_sub_tt3,dc0_epi_tt3)
[h_subvsepi_at,p5]=kstest2(dc0_sub_at,dc0_epi_at)

